< previous page page_285 next page >

Page 285
They offer slightly better performance.
API calls made using type libraries take less space in your VB executable.
You can link the API declarations into a help file.
They have the following disadvantages:
You must recompile the IDL file every time you make a change.
Once you have created a function definition in a type library, you should not change it lest you break other applications that use the type library.
You must learn IDL.
My book Dan Appleman's Visual Basic Programmer's Guide to the Win32 API includes a chapter on the creation of type libraries.2
This puzzle book exclusively uses the Declare approach to calling API functions. Why? Because solving these puzzles will require experimentation with declarations, and it is far easier to do this kind of experimentation using Declare statements than type libraries. I've found in my own experience that it is easier to develop and test my application using the Declare statement. Once the application is developed, I rarely have a good reason to switch to a type library.
7017a6ead0e3c4111b47a554df321e9f.gif 7017a6ead0e3c4111b47a554df321e9f.gif
2 The chapter on type libraries is only available in the online version of the book included on the book's CD-ROMit does not appear in the printed version. The book also includes an API type library that covers all of the functions described in the book, along with source code. The declarations are also linked to the CD-ROM edition of the book, making it very easy to obtain help on any function call.

 
< previous page page_285 next page >